#include <QtGui/QApplication>
#include <QDeclarativeView>
#include <QDeclarativeEngine>
#include <QGLWidget>

#include "collisionrectangle.h"
#include "collisionpolygon.h"
#include "world.h"

#include "mapitem.h"
#include "AudioObject.h"


int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    qmlRegisterType<CollisionRectangle>("Kookaburra", 1, 0, "CollisionRectangle");
    qmlRegisterType<CollisionPolygon>("Kookaburra", 1, 0, "CollisionPolygon");
    qmlRegisterType<World>("Kookaburra", 1, 0, "World");

    qmlRegisterType<MapItem>("Kookaburra", 1, 0, "TileMap");

    qmlRegisterType<AudioObject>("Kookaburra", 1, 0, "Audio");

    QDeclarativeView canvas;
    canvas.engine()->addImportPath("plugins/");
    canvas.setViewport(new QGLWidget());

    canvas.setSource(QString("Game.qml"));
    QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit()));

    canvas.show();

    return app.exec();
}
